﻿using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Data;
using System.Windows.Media;

namespace LaserAutoTest.UI
{
    public class ValueToBrushConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            double number = (double)value;
            if (number > (double)parameter)
            {
                return Brushes.Red; // 返回大于某个值的颜色  
            }
            else
            {
                return Brushes.Transparent; // 返回默认颜色或背景色  
            }
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            return Brushes.Transparent; // 返回默认颜色或背景色  
        }
    }
}
